class MinStack:

    def __init__(self):
        """
        initialize your data structure here.
        """
        self.nums = []
        self.min_stack = [float('inf')]


    def push(self, val: int) -> None:
        self.nums.append(val)
        self.min_stack.append(min(val,min(self.min_stack)))



    def pop(self) -> None:
        self.nums.pop()
        self.min_stack.pop()


    def top(self) -> int:
        return self.nums[-1]


    def getMin(self) -> int:
        return self.min_stack[-1]